﻿using System.Diagnostics.CodeAnalysis;
using Swimj.CommonLib.Attributes;
using Swimj.CommonLib.Constants;

namespace Admin.CommonLib.Models.Permission
{
    public class PermissionInfoResponseDto
    {
        public Guid Key { get; set; }

        public Guid? TenantId { get; set; }

        [TableColumn(DisplayText = "权限编码")]
        [ExcelColumn(DisplayText = "权限编码", Indent = nameof(Level))]
        [NotNull]
        public string? Code { get; set; }

        [TableColumn(DisplayText = "权限名称")]
        [ExcelColumn(DisplayText = "权限名称")]
        [NotNull]
        public string? Name { get; set; }

        [ExcelColumn(DisplayText = "所属权限编码")] public string? ParentCode { get; set; }

        [ExcelColumn(DisplayText = "所属权限名称")] public string? ParentName { get; set; }

        public Guid? ParentId { get; set; }

        [TableColumn(DisplayText = "Url")]
        [ExcelColumn(DisplayText = "Url")]
        public string? Uri { get; set; }

        [TableColumn(DisplayText = "权限类型")]
        [ExcelColumn(DisplayText = "权限类型")]
        [NotNull]
        public string? PermissionType { get; set; }

        [TableColumn(DisplayText = "图标", ColumnType = ColumnType.Custom)]
        [ExcelColumn(DisplayText = "图标")]
        public string? Icon { get; set; }

        public string? Description { get; set; }

        public bool IsVisible { get; set; }

        [TableColumn(DisplayText = "排序")]
        [ExcelColumn(DisplayText = "排序")]
        public int Sort { get; set; }

        public int Level { get; set; }
    }
}